package U6;

import java.util.Scanner;

public class Test1 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			int n = sc.nextInt();
			int t = sc.nextInt();
			int[] a = new int[n];
			for (int i = 1; i < n; i++) {
				a[i] = sc.nextInt();
			}
			int index = 1;
			while (true) {
				index = index + a[index];
				if (index == t) {
					System.out.println("YES");
					break;
				}
				if (index > t) {
					System.out.println("NO");
					break;

				}

			}
		}
	}

}
